<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Using custom HTML</title>
</head>
<body>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.2.0/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.2.0/highlight.min.js"></script>
<pre>
    <code id="example1">
let a = 123;
console.log(a);
function abc(){}
class bb{
  constructor(){}
  do(){}
}
for(let i=0;i<3;++i){
  console.log(i)
}
console.log(a)
const a = require('hightlight.js')
    </code>
</pre>

<script>
  // highlightElement: (element: HTMLElement) => void
  const r = hljs.highlightElement(example1)


  /*
    Applies highlighting to a DOM node containing code.
    对包含代码的DOM节点应用高亮显示。


    This function is the one to use to apply highlighting dynamically after page load or within initialization code of third-party JavaScript frameworks.
    该函数用于在页面加载后或在第三方JavaScript框架的初始化代码中动态应用高亮显示。

    The function uses language detection by default but you can specify the language in the class attribute of the DOM node. See the scopes reference for all available language names and scopes.
    该函数默认使用语言检测，但您可以在DOM节点的class属性中指定语言。有关所有可用的语言名称和作用域，请参阅作用域参考。
  */

  console.log(r); //undefined

</script>
</body>
</html>
